<?php
App::uses('AppController', 'Controller');
/**
 * Accounts Controller
 *
 * @property Account $Account
 */
class AccountsController extends AppController {
	

/**
 * index method
 *
 * @return void
 */
	public function summary() {
				
		$this->Account->recursive = 0;
		
		$this->set('accounts', 
			$this->paginate(
				array(
					'Account.customer_id' =>  $this->Session->read('Auth.User.customer_ids')
				)
			)
		);
	}

/**
 * view method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function view($id = null) {
		$this->Account->id = $id;
		if (!$this->Account->exists()) {
			throw new NotFoundException(__('Invalid account'));
		}
		$this->set('account', $this->Account->read(null, $id));
	}


}